package org.gavin.core.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.gavin.core.conf.SensitiveJsonSerializer;

import java.lang.annotation.*;

/**
 * FieldMask
 * 对象属性 脱敏输出
 * @author grl
 * @date 2024/1/11
 */

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.TYPE})
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveJsonSerializer.class)
public @interface FieldMask {
    /**
     * 开头明文展示个数
     * @return
     */
    int prefix() default 0;

    /**
     * 结尾明文展示个数
     * @return
     */
    int suffix() default 0;
}
